<div style="width:725px; height:inherit; margin-left:10px; float:right;">
    <div id="boxContent" align="left">
        <div class="textformTop" style="color:#000; float:left;">ADMIN</div>
        <!--<div id="relaLink"><a href="#" style="color:#999;">Ký Gửi</a> | <a href="#" style="color:#999;">Rút</a></div>-->
    </div>
    <div id="ContentContainer">
        <div>
            <div class="div-tab">
                <ul>
                    <li class="active">
                        Lệnh Gửi
                        {{if isset($data['newitem']) and count($data['newitem'])!=0}}
                        <span id="alert1" class="kg_alert">{{count($data['newitem'])}}</span>
                        {{else}}
                        <span id="alert1" class="kg_alert" style="display: none;"></span>
                        {{/if}}
                    </li>
                    <li>Lệnh Rút</li>
                    <li>
                        Cộng/Trừ Vật Phẩm
                        {{if isset($data['trans-item']) and count($data['trans-item'])!=0}}
                        <span id="alert3" class="kg_alert">{{count($data['trans-item'])}}</span>
                        {{else}}
                        <span id="alert3" class="kg_alert" style="display: none;"></span>
                        {{/if}}
                    </li>
                </ul>
            </div>
            <div class="tab-container" style="min-height: 500px;position: relative;">
                <span id="kg-result"></span>
                <div class="kg-left">
                    <h3>Danh sách mới gửi</h3>
                    <div class="div-list">
                        {{if isset($data['newitem'])}}
                        <div style="overflow-y: scroll;height: 370px;">
                        <ul id="ad-list-1" class="ul-list" style="overflow: hidden;">
                            {{foreach $data['newitem'] as $item}}
                            {{$game = $db_game_model->getGameByGID($item->gid,1)}}
                            <li><a href="javascript:;" onclick="getitem({{$item->id}},1);" title="{{$item->name}}"><span class="mark1">[{{$game[0]->name}}] </span>{{$item->name|truncate:75:'...'}}</a></li>
                            {{/foreach}}
                        </ul>
                        </div>
                        {{/if}}
                    </div>
                </div>
                <div class="kg-right">
                    <div id="r-top-1" class="r-top"></div>
                    <!--<div class="r-middle"></div>-->
                    <!--<div class="r-bottom">
                        <div>
                            Game <span class="info1">Chinh Đồ</span>, server <strong>Bá Long</strong> gửi <strong>Dao +1</strong> với số lượng <input type="text"/>
                        </div>
                        <table>
                            <tr>
                                <td>
                                    <input type="radio" name="confirm_trans" />Giao dịch hợp lệ
                                </td>
                                <td>
                                    <input type="radio" name="confirm_trans" />Hủy giao dịch
                                </td>
                            </tr>
                        </table>
                        <div>
                            <table>
                                <tr>
                                    <td></td>
                                </tr>
                            </table>
                        </div>
                    </div>-->
                </div>
            </div>
            <div class="tab-container">
                
            </div>
            <div class="tab-container" style="min-height: 500px;position: relative;">
                <div class="kg-left">
                    <h3>Cộng/Trừ vật phẩm</h3>
                    <div class="div-list">
                        {{if isset($data['trans-item'])}}
                        <div style="overflow-y: scroll;height: 370px;">
                        <ul id="ad-list-3" class="ul-list" style="overflow: hidden;">
                            {{foreach $data['trans-item'] as $item}}
                            {{$game = $db_game_model->getGameByGID($item->gid,1)}}
                            <li><a href="javascript:;" onclick="getitem2('{{$item->transID}}',3);" title="{{$item->name}}"><span class="mark1">[{{$game[0]->name}}] </span>{{$item->name|truncate:75:'...'}}</a></li>
                            {{/foreach}}
                        </ul>
                        </div>
                        {{/if}}
                    </div>
                </div>
                <div class="kg-right">
                    <div id="r-top-3" class="r-top"></div>
                
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function(){
        //Load tự động theo thời gian để cập nhật các lệnh mới ký gửi
        var newitem = setInterval(function(){
            $.ajax({
                url: base_url+'ajax_excution/getnewitem',
                type: 'POST',
                data: {
                    trans_order:1,
                    confirm_order:0
                },
                dataType: 'text',
                success:function(data){
                    var result = JSON.parse(data);//console.log(result.length);
                    var li = "";
                    if(result.code==1){
                        $("#alert1").html(result.msg.length);
                        $("#alert1").show();
                        //danh sách
                        for(var i=0;i<result.msg.length;i++)
                        {
                            li+= "<li><a href='javascript:;' onclick='getitem("+result.msg[i].id+",1);' title='"+result.msg[i].name+"'><span class='mark1'>["+result.msg[i].game_name+"] </span>"+result.msg[i].name+"</a></li>";
                        }
                        $("#ad-list-1").empty();
                        $("#ad-list-1").html(li);
                    }
                    else
                    {
                        //$("#alert1").hide();
                        clearInterval(newitem);
                    }
                },
                error:function(){}
            });
        }, 10000);
        
        var transitem = setInterval(function(){
            $.ajax({
                url: base_url+'ajax_excution/gettransitem',
                type: 'POST',
                data: {
                    trans_order:1,
                    confirm_order:1
                },
                dataType: 'text',
                success:function(data){
                    var result = JSON.parse(data);//console.log(result.length);
                    var li = "";
                    if(result.code==1){
                        $("#alert3").html(result.msg.length);
                        $("#alert3").show();
                        //danh sách
                        for(var i=0;i<result.msg.length;i++)
                        {
                            li+= "<li><a href='javascript:;' onclick=getitem2('"+result.msg[i].transID+"',3); title='"+result.msg[i].name+"'><span class='mark1'>["+result.msg[i].game_name+"] </span>"+result.msg[i].name+"</a></li>";
                        }
                        $("#ad-list-3").empty();
                        $("#ad-list-3").html(li);
                    }
                    else
                    {
                        //$("#alert1").hide();
                        clearInterval(transitem);
                    }
                },
                error:function(){}
            });
        }, 10000);
    })
</script>